module.exports = app => {
    const { INTEGER, DATE } = app.Sequelize;
    const Blacklist = app.model.define('blacklist', {
        id: {
            type: INTEGER(20),
            primaryKey: true,
            autoIncrement: true,
            comment:"自增ID"
        },
        userId: {
            type: INTEGER(20),
            allowNull: false,
            defaultValue: 0,
            comment: '用户id'
        },
        blackedId: {
            type: INTEGER(20),
            allowNull: false,
            defaultValue: 0,
            comment: '被拉黑用户id'
        },
        created_time: DATE,
        updated_time: DATE,
    });
    // 关联关系
    Blacklist.associate = function (models) {
        // 关联用户
        Blacklist.belongsTo(app.model.User);
    }
    return Blacklist;
};